
import 'package:flutter/material.dart';

import '../constant/res.dart';
import 'Styles.dart';

/// @class : empty_widget
/// @date : 2022-09-26 15:16
/// @name : LFC
/// @description :  公用的空佈局
class EmptyWidget extends StatefulWidget {
  final String? emptyText;

  const EmptyWidget({Key? key, required this.emptyText}) : super(key: key);

  @override
  State<EmptyWidget> createState() => _EmptyWidgetState();
}

class _EmptyWidgetState extends State<EmptyWidget> {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          Image.asset(
            Res.image_empty,
            width: 180,
            height: 140,
          ),
          Text(
            widget.emptyText ?? "暫無數據",
            style: const TextStyle(fontSize: 18, color: Styles.c_666,fontWeight: FontWeight.w500),
          ),
        ],
      ),
    );
  }
}
